package com.example.blog.controller.admin;

import com.example.blog.pojo.LoginRequest;
import com.example.blog.pojo.Result;
import com.example.blog.service.AdminService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/admins")
public class AdminController {
    @Resource
    private AdminService adminService;

    @PostMapping("/login")
    public Result login(@RequestBody LoginRequest loginRequest, HttpServletResponse response) {
        return adminService.login(loginRequest,response);
    }
}
